package ch.app.huawei;

import java.util.Scanner;

/**
 * Created by otp on 2020/12/12.
 */
public class MainString {

    public static void main(String [] args) {
        //reverse();
        charAt();
    }

    public static void reverse() {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个字符串(中间能加空格或符号)");
        String a = input.nextLine();
        StringBuffer s = new StringBuffer(a);
        System.out.println(s.reverse());
    }

    public static void charAt() {
        String a = "hi james";
        char[] arry = a.toCharArray();
        String str = "";
        for (int i = 0; i <arry.length ; i++) {
            //System.out.println(arry[i]);
            String xc = String.valueOf(arry[i]);
            System.out.println("asd:" + xc);
            str +=arry[i];
        }
        System.out.println(str);
    }
}
